package com.cloud.fim.gate.bean;

import com.cloud.fim.common.Bootstrap;
import com.cloud.fim.gate.ImGateApp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2019-12-05 20:48
 */
public class SpringImApplication {
    public static ConfigurableApplicationContext run(Class<?> primarySource, String... args) {
        ConfigurableApplicationContext context = SpringApplication.run(ImGateApp.class, args);
        Bootstrap bootstrap = context.getBean(Bootstrap.class);
        bootstrap.start();
        return context;
    }
}
